package newcoder_exp.justPractise;
import java.util.*;
import org.junit.*;
public class NC56 {
    public class Solution {
        public boolean isPalindrome (int x) {
            if (x < 0) return false;
            else if (x <= 9) return true;
            long y = x;
            long z = 0;
            long r = 0, d = 10;
            while (x != 0) {
                r = x % d;
                z = z * 10 + r;
                x /= 10;
            }
            System.out.println(z);
            return z == y;
        }
    }

    @Test
    public void test() {
        Solution s = new Solution();
        int[] nums = new int[]{};
        System.out.println(s.isPalindrome(2147007412));
        System.out.println(s.isPalindrome(14241));

    }
}
